home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / etc / grub.d / 05_debian_theme < prev    next >
Text File  |  2009-10-23  |  1KB  |  52 lines

  1. #!/bin/bash -e
  2.  
  3. source /usr/lib/grub/grub-mkconfig_lib
  4.  
  5. set_mono_theme()
  6. {
  7.   cat << EOF
  8. set menu_color_normal=white/black
  9. set menu_color_highlight=black/white
  10. EOF
  11. }
  12.  
  13. # check for usable backgrounds
  14. use_bg=false
  15. if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
  16.   for i in {/boot/grub,/usr/share/images/desktop-base}/moreblue-orbit-grub.{png,tga} ; do
  17.     if is_path_readable_by_grub $i ; then 
  18.       bg=$i
  19.       case ${bg} in
  20.         *.png)        reader=png ;;
  21.         *.tga)        reader=tga ;;
  22.         *.jpg|*.jpeg)    reader=jpeg ;;
  23.       esac
  24.       if test -e /boot/grub/${reader}.mod ; then
  25.         echo "Found Debian background: `basename ${bg}`" >&2
  26.         use_bg=true
  27.         break
  28.       fi
  29.     fi
  30.   done
  31. fi
  32.  
  33. # set the background if possible
  34. if ${use_bg} ; then
  35.   prepare_grub_to_access_device `${grub_probe} --target=device ${bg}`
  36.   cat << EOF
  37. insmod ${reader}
  38. if background_image `make_system_path_relative_to_its_root ${bg}` ; then
  39.   set color_normal=black/black
  40.   set color_highlight=magenta/black
  41. else
  42. EOF
  43. fi
  44.  
  45. # otherwise, set a monochromatic theme for Ubuntu
  46. if ${use_bg} ; then
  47.   set_mono_theme | sed -e "s/^/  /g"
  48.   echo "fi"
  49. else
  50.   set_mono_theme
  51. fi
  52.